package com.qidian.mes.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qidian.mes.excel.OrderSourceTypeConvert;
import com.qidian.mes.excel.OrderWoStatusConvert;
import com.qidian.mes.excel.OrderWoTypeConvert;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.beans.Transient;
import java.util.Date;
import java.util.List;

/**
 * @Author dqy
 * @Description
 * @Time 2024/4/13 15:24
 */
@Data
@HeadRowHeight(25)
@ContentRowHeight(20)
@ColumnWidth(20)
public class Order {
    @ExcelProperty(value = "工单id", index = 0)
    private Long woId; // 工单id
    @ExcelProperty(value = "工单编号", index = 1)
    private String woCode; // 工单编号
    @ExcelProperty(value = "工单名称", index = 2)
    private String woName;// 工单名称
    @ExcelProperty(value = "父工单编号", index = 3)
    private Long woParentId;// 父工单id
    @ExcelProperty(value = "来源类型", index = 4,converter = OrderSourceTypeConvert.class)
    private Integer sourceType; // 来源类型 1：客户订单 2：库存备货
    @ExcelProperty(value = "订单编号", index = 5)
    private String orderNum; // 订单编号
    @ExcelProperty(value = "订单类型", index = 6,converter = OrderWoStatusConvert.class)
    private Integer woStatus; // 单据状态 1：草稿 2：已确认 3：已完成
    @ExcelProperty(value = "工单类型", index = 7,converter = OrderWoTypeConvert.class)
    private Integer woType; // 工单类型 1：自产 2：外购 3：外协
    @ExcelProperty(value = "产品编号", index = 8)
    private Long matId; // 产品编号
    @ExcelProperty(value = "产品名称", index = 9)
    private String matName; // 产品名称
    @ExcelProperty(value = "规格型号", index = 10)
    private String matModel; // 规格型号
    @ExcelProperty(value = "单位", index = 11)
    private String matUnit; // 单位
    @ExcelProperty(value = "工单数量", index = 12)
    private Long woQuantity; // 工单数量
    @ExcelProperty(value = "需求日期", index = 13)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date requireTime; // 需求日期
    @ExcelProperty(value = "批次号", index = 14)
    private Long batch; // 批次号
    @ExcelProperty(value = "客户编码", index = 15)
    private Long customerCode; // 客户编码
    @ExcelProperty(value = "客户名称", index = 16)
    private String customerName; // 客户名称
    @ExcelProperty(value = "供应商编码", index = 17)
    private Long supplierCode; // 供应商编码
    @ExcelProperty(value = "供应商名称", index = 18)
    private String supplierName; // 供应商名称
    @ExcelProperty(value = "备注", index = 19)
    private String notes; // 备注
    @ExcelIgnore
    private List<Order> children;// 子工单

}
